package com.csproj.system.service.dto;


import com.csproj.system.domain.RoleInfo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import com.sun.activation.registries.MailcapParseException;

import java.io.Serializable;

import java.util.*;


/**
 * A DTO for the UserInfo entity.
 */
public class UserInfoDTO implements Serializable {


    private String id;

    private String name;            //姓名

    private String account;         //帐号

    private String password;        //密码

    private String code;            //用户编号

    private Boolean usedFlag;         //是否停用


    private String remark;           //停用原因

    private Integer type;

    private String siteId;

    private String siteName;

    private String phone;

    private Integer sex;

    private Integer sort;

    private String[] roleInfoIds;

    private Set<RoleInfo> roleInfos;

    //扩展字段
    private String oldPass;


    public String getOldPass() {
        return oldPass;
    }

    public void setOldPass(String oldPass) {
        this.oldPass = oldPass;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Boolean getUsedFlag() {
        return usedFlag;
    }

    public void setUsedFlag(Boolean usedFlag) {
        this.usedFlag = usedFlag;
    }


    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Set<RoleInfo> getRoleInfos() {
        return roleInfos;
    }

    public void setRoleInfos(Set<RoleInfo> roleInfos) {
        this.roleInfos = roleInfos;
    }

    public String[] getRoleInfoIds() {
        return roleInfoIds;
    }

    public void setRoleInfoIds(String[] roleInfoIds) {
        this.roleInfoIds = roleInfoIds;
    }

    /*
    public Set<String> getRoleInfos() {
        return roleInfos;
    }
*/

    @Override
    public boolean equals(Object o) {
        List<MailcapParseException> list = new ArrayList<>();
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        UserInfoDTO userInfoDTO = (UserInfoDTO) o;

        if ( ! Objects.equals(id, userInfoDTO.id)) { return false; }

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "UserInfoDTO{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", code='" + code + '\'' +
                ", usedFlag=" + usedFlag +
                ", type=" + type +
                ", phone='" + phone + '\'' +
                ", sex=" + sex +
                ", sort=" + sort +
                ", roleInfoIds=" + Arrays.toString(roleInfoIds) +
                ", roleInfos=" + roleInfos +
                '}';
    }

    public String getSiteId() {
        return siteId;
    }

    public void setSiteId(String siteId) {
        this.siteId = siteId;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }
}
